package com.example.demo.mapper;


import com.example.demo.identity.ChatMessages;
import com.example.demo.identity.ChatMessages;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ChatMessageMapper {


    @Select("select content, timestamp from chatMessage where senderId = #{senderId} and reveiced = #{reveiced}")
    List<ChatMessages> chatList(@Param("senderId") String senderId, @Param("reveiced") String reveiced);


    @Insert("insert into chatMessage(content, senderId, timestamp, reveiced) values (#{content}, #{senderId}, #{timestamp}, #{reveiced})")
    int insertChatMessage(ChatMessages chatMessage);

}
